home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 101
/
FreelogNo101-JanvierFevrier2011.iso
/
Multimedia
/
MediaCope
/
MediaCopeSetup.exe
/
{app}
/
extensions
/
Speak Text
/
content
/
overlay.js
< prev
Wrap
Text File
|
2009-11-02
|
2KB
|
56 lines
var speaktext = {
onLoad: function() {
this.initialized = true;
document.getElementById("contentAreaContextMenu")
.addEventListener("popupshowing", function(e) { speaktext.showContextMenu(e); }, false);
},
showContextMenu: function(event) {
document.getElementById("context-speaktext0").hidden = !gContextMenu.isTextSelected;
},
onMenuItemCommand: function(e, i) {
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
file.initWithPath("C:\\Speak Text.exe");
var process = Components.classes["@mozilla.org/process/util;1"]
.createInstance(Components.interfaces.nsIProcess);
process.init(file);
sSelectedText = "No Text Selected";
if(gContextMenu.isTextSelected)
{
var focusedWindow = document.commandDispatcher.focusedWindow;
if (focusedWindow == window) focusedWindow = window._content;
sSelectedText = focusedWindow.getSelection();
}
var wrk = Components.classes["@mozilla.org/windows-registry-key;1"]
.createInstance(Components.interfaces.nsIWindowsRegKey);
wrk.create(wrk.ROOT_KEY_CURRENT_USER, "Software\\Microsoft\\Internet Explorer\\LowRegistry\\Media Cope\\Media Cope\\Speak Text\\", wrk.ACCESS_WRITE);
wrk.writeStringValue("", sSelectedText);
wrk.close();
var args = ["0", i];
process.run(false, args, args.length);
},
};
window.addEventListener("load", function(e) { speaktext.onLoad(e); }, false);